package org.boot.controller;

import org.boot.dao.CityRepository;
import org.boot.entity.City;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/city")
public class CityController {

    @Autowired
    private CityRepository cityRepository;

    @RequestMapping("/save")
    String addCity() {
        City city = City.builder().id(1L).name("jack").state("true").build();
        cityRepository.save(city);
        return "save city";
    }


}
